{meta_html js $j_basepath.'design/back/js/popup.js'}

{assign $pathMiniature = PHOTO_ANNONCE_PATH}
{literal}
    <style type="text/css">
      v\:* {ldelim}
        behavior:url(#default#VML);
     {rdelim} 
     .marked{
         color : red;
     }

     /* ::: popin ::: */
#masque{position:absolute; top:0; left:0; display:none; cursor:wait; background:black; z-index:799; }
.pop-up{display:block;  height:auto; left:0; position:absolute; top:-1000px; width:60%; z-index:800; background:#fff; padding:25px; border:5px solid #cdcdcd;}
a.showpopin{position:absolute; right:10px; top:235px; width:38px; height:40px;}
    </style>
    <script type='text/javascript'>
        $(function(){
            switchThumbs($('#forPop a:first').attr('href'), "");
            
            $("#thumbs ul.thumbs a img").click(function(){
                switchThumbs($(this).attr('src'), $('.showpopin').attr('href'));
            });
        });
        function switchThumbs(srcClick, srcZoom){
            
            if (srcZoom != srcClick ){
                var contentOfDiv = "";
                $('.showpopin').attr('href',srcClick);
                if(srcZoom != ""){
                    contentOfDiv += '<a rel="prettyPhoto[pp_gal]" class="thumb" href="'+srcZoom+'" >';
                    contentOfDiv += '<img  src="'+srcZoom+'" width="60" />';
                    contentOfDiv += '</a>';
                }
                
                $('#forPop a').each(function(){
                    if ($(this).attr('href') != srcClick ){
                        contentOfDiv += '<a rel="prettyPhoto[pp_gal]" class="thumb" href="'+$(this).attr('href')+'" >';
                        contentOfDiv += '<img  src="'+$(this).attr('href')+'" width="60" />';
                        contentOfDiv += '</a>';
                    }
                });
                $("#forPop").html(contentOfDiv);
                $("a[rel^='prettyPhoto']").prettyPhoto({
                    social_tools: ''
                });
            } 
        }
        /**
         * affiche un pop
         */
    </script>
{/literal}
<div id="main_container"> {$oZoneHeader}
  <div class="main_content"> {$oZoneTopMenu}
    <form action="" method="" id="" name="">
      <div class="center_content">
        <div class="right_content" style="width:972px; padding:30px 15px 0;">
          <h2>Prévisualiser mon annonce</h2>
          <div id="prevPrix">
          	<div class="wrap2">
            	<div class="l1"><label>Prix</label>
                    <div>+ haut : {$moyenne->prixHaut}€</div>
                    <div>+ bas : {$moyenne->prixBas}€</div>
                    <div>{$moyenne->prixMoyen}</div>
                    <div>Px moy corrigée : {$moyenne->pmc}</div>
                </div>
                <div class="l2"><label>Km</label>
                    <div>+ bas : {$moyenne->kmBas}km</div>
                    <div>+ haut : {$moyenne->kmHaut}km</div>
                    <div>{$moyenne->kmMoyen}</div>
                </div>
            </div>
          </div><!--end prevPrix-->
          <div id="prevCenter">
          	<div class="zone1">
                  <div class="cadre1">
                      <div class="rows"><strong class="name">{$marque} {$modele} {$voiture->Occas_Version}</strong><span class="prix {if ( isset($modifAnonce) && in_array("Occas_Prix",$modifAnonce->modifVoiture))} marked{/if}">{$voiture->Occas_Prix} euros</span>
                      	<!-- 1euro = 6.55957 F -->
                      	<span class="prix2">({assign $pf = ($voiture->Occas_Prix * 6.55957)}{$pf} F)</span>
                      </div>
                  </div>
                <div class="clear">&nbsp;</div>
            	<div class="cadre2">
                	<div class="title">&nbsp;</div>
                    <div class="rows {if ( isset($modifAnonce) && in_array("Occas_Kilometrage",$modifAnonce->modifVoiture))} marked{/if}">{$voiture->Occas_Kilometrage} km</div>
                    <div class="rows {if ( isset($modifAnonce) && in_array("Occas_Millesime",$modifAnonce->modifVoiture))} marked{/if}">Millésime {$voiture->Occas_Millesime}</div>
                    <div class="rows {if ( isset($modifAnonce) && in_array("Occas_MiseCirculation",$modifAnonce->modifVoiture))} marked{/if}">Immatriculé en {$voiture->Occas_MiseCirculation}</div>
                    <div class="rows">Département {$dpt}</div>
                </div>
                <!--gallery photo-->
                    <div style="float:right; width:468px; height:304px; margin:0 0 20px;">
                    	<div style="width:361px; overflow:hidden; position:relative; margin:0 0 10px; float:right;
                        {if ( isset($modifAnonce) && ($modifAnonce->modifPhotos == 1))} border:1px solid red;{/if}
                        ">
                	<!--begin gallery-->
                        <div id="gallery">
                          <div id="controls" class="controls"></div>
                          <div class="slideshow-container">
                            <div id="loading" class="loader"></div>
                            <div id="slideshow" class="slideshow"></div>
                          </div>
                          <div id="caption" class="caption-container"></div>
                        </div>
                        <div id="thumbs" class="navigation">
                          <ul class="thumbs" style="width:324px; overflow:hidden;">
                              {if sizeof($photo)}
                                    {foreach $photo as $itemPhoto}
                                        {if $itemPhoto->photo_name}
                                            <li><a class="thumb" href="{$imgPath}{$itemPhoto->photo_name}"><img  src="{$imgPath}{$itemPhoto->photo_name}" width="61" /></a></li>
                                        {/if}
                                    {/foreach}
                                {elseif $annonceS->marque_logo}
                                    <li><a class="thumb" href="{$annonceS->marque_logo}"><img   src="{$annonceS->marque_logo}" width="61" /></a></li>
                                {else}
                                    <li><a class="thumb" href="{$j_basepath}design/front/images/no-image-home2.jpg"><img  src="{$j_basepath}design/front/images/no-image-home2.jpg" width="61"  /></a></li>
                                {/if}
                          </ul>
                        </div>
                          <a href="{$annonceS->marque_logo}"  rel="prettyPhoto[pp_gal]" class="showpopin"><img alt="" src="{$j_basepath}design/front/images/zoom.png" title="Zoom" /></a>
                        <div class="clear">&nbsp;</div>
                        
                        </div>
                    </div>
                <div style="display:none" id="forPop">
                    {if sizeof($photo)}
                        {foreach $photo as $key=>$itemPhoto}
                            {if ($itemPhoto->photo_name)}
                                <a class="thumb" href="{$imgPath}{$itemPhoto->photo_name}" rel="prettyPhoto[pp_gal]">
                                    <img  src="{$imgPath}{$itemPhoto->photo_name}" width="60" />
                                </a>
                            {/if}
                        {/foreach}
                    {elseif $annonceS->marque_logo}
                        <a rel="prettyPhoto[pp_gal]" class="thumb" href="{$annonceS->marque_logo}"><img  src="{$annonceS->marque_logo}" width="60" /></a>
                    {else}
                        <a rel="prettyPhoto[pp_gal]" class="thumb" href="{$j_basepath}design/front/images/no-image-home2.jpg"><img  src="{$j_basepath}design/front/images/no-image-home2.jpg" width="60" /></a>
                    {/if}
                </div>
                <!-- end gallery photo-->
                <div class="clear">&nbsp;</div><br /><br /><br />
                <div class="cadre1">
                	<div class="title"><span class="sp1">Caractéristiques</span><span class="sp2">Commentaire</span></div>
                    <div class="wrap">
                    	<div class="d1">
                          <p {if ( isset($modifAnonce) && in_array("Occas_Groupe",$modifAnonce->modifVoiture))} class='marked'{/if}>{$categ}</p>
                              <p>
                                  <span {if ( isset($modifAnonce) && in_array("Occas_Carburation",$modifAnonce->modifVoiture))} class='marked'{/if}>
                                  {$carbu} </span>
                                  - 
                                  <span {if ( isset($modifAnonce) && in_array("Occas_ChevFisc",$modifAnonce->modifVoiture))} class='marked'{/if}>
                                  {$voiture->Occas_ChevFisc}
                                  </span>
                                  </p>
                              <p {if ( isset($modifAnonce) && in_array("Occas_Bt_Vitesse",$modifAnonce->modifVoiture))} class='marked'{/if}
                                  >boîte {$voiture->Occas_Bt_Vitesse} vitesses</p>
                              
                              <p {if ( isset($modifAnonce) && in_array("Occas_NbPorte",$modifAnonce->modifVoiture))} class='marked'{/if}
                                  >{$voiture->Occas_NbPorte} portes</p>
                              <p {if ( isset($modifAnonce) && in_array("Occas_Couleur",$modifAnonce->modifVoiture))} class='marked'{/if}
                                  >{$voiture->Occas_Couleur}</p>
                              <p {if ( isset($modifAnonce) && in_array("Occas_CT",$modifAnonce->modifVoiture))} class='marked'{/if}
                                  >
                              {if $voiture->Occas_CT}contrôle technique {/if}
                              {if (($voiture->Occas_CT) == 1)}recalé{/if}
                              {if (($voiture->Occas_CT) == 2)}vierge{/if}
                              {if (($voiture->Occas_CT) == 3)}OK{/if}
                              {if (($voiture->Occas_CT) == 4)}Non nécessaire{/if}
                              {if (($voiture->Occas_CT) == 5)}non effectué{/if}
                              </p>
                          </div>
                        <div class="d2">
                            <p {if ( isset($modifAnonce) && in_array("Occas_Commentaire",$modifAnonce->modifVoiture))} class='marked'{/if}>{$voiture->Occas_Commentaire}</p>
                        </div>
                    </div>
                </div><!--end cadre1-->
                <div class="cadre1">
                	<div class="title">Coordonnées du vendeur</div>
                    <div class="rows"><label><strong>Nom : </strong></label>
                        <strong>
                            {if isset($vendeur->Vendeur_Nom)}
                                <span 
                                {if ( isset($modifAnonce) && in_array("Vendeur_Nom",$modifAnonce->modifVendeur))} class='marked'{/if}>
                                {$vendeur->Vendeur_Nom}
                                <span>
                            {/if}</strong>
                    </div>
                    {if isset($vendeur->Vendeur_Tel_Port) && ($vendeur->Vendeur_Tel_Port !='')}
                        <div class="rows"><label><strong>Tél. port : </strong></label>
                            <strong>
                               <span 
                                {if ( isset($modifAnonce) && in_array("Vendeur_Tel_Port",$modifAnonce->modifVendeur))} class='marked'{/if}>
                                {$vendeur->Vendeur_Tel_Port}
                                <span> 
                            
                            </strong>
                        </div>
                    {/if}
                    {if isset($vendeur->Vendeur_Tel_Dom) && ($vendeur->Vendeur_Tel_Dom !='')}
                        <div class="rows"><label><strong>Tél. domicile : </strong></label>
                            <strong>
                               <span 
                                {if ( isset($modifAnonce) && in_array("Vendeur_Tel_Dom",$modifAnonce->modifVendeur))} class='marked'{/if}>
                                {$vendeur->Vendeur_Tel_Dom}
                                <span> 
                            
                            </strong></div>
                    {/if}
                    {if isset($vendeur->Vendeur_Tel_Bureau)  && ($vendeur->Vendeur_Tel_Bureau !='')}
                        <div class="rows"><label><strong>Tél. bureau: </strong></label>
                            <strong>
                               <span 
                                {if ( isset($modifAnonce) && in_array("Vendeur_Tel_Bureau",$modifAnonce->modifVendeur))} class='marked'{/if}>
                                {$vendeur->Vendeur_Tel_Bureau}
                                <span> 
                            
                            </strong></div>
                    {/if}

                </div>
            </div>
            <div class="zone2">
                <!--  param de connex -->
                 {if isset($vendeur)}
                     <div class="cadre1">
                        <div class="title">Paramètres de connexion</div>
                        <div class="rows"><label>Nom : </label>
                        {if isset($vendeur->Vendeur_Nom)}
                            <span {if ( isset($modifAnonce) && in_array("Vendeur_Nom",$modifAnonce->modifVendeur))} class='marked'{/if}>
                            {$vendeur->Vendeur_Nom}</span>
                        {/if}
                        </div>
                        <div class="rows"><label>Date naissance : </label>
                        {if isset($vendeur->Vendeur_Naissance)}
                            <span {if ( isset($modifAnonce) && in_array("Vendeur_Naissance",$modifAnonce->modifVendeur))} class='marked'{/if}>
                            {$vendeur->Vendeur_Naissance}
                            </span>
                        {/if}
                        </div>
                        <div class="rows"><label>Immatriculation : </label>
                        {if isset($voiture->Occas_NumImmatricul)}
                            <span {if ( isset($modifAnonce) && in_array("Occas_NumImmatricul",$modifAnonce->modifVoiture))} class='marked'{/if}>
                            {$voiture->Occas_NumImmatricul}
                            <span>
                        {/if}
                        </div>
                        <div class="rows"><label>email : </label>
                        {if isset($vendeur->Vendeur_Email)}
                            <span {if ( isset($modifAnonce) && in_array("Vendeur_Email",$modifAnonce->modifVendeur))} class='marked'{/if}>
                            {$vendeur->Vendeur_Email}
                            </span>
                        {/if}
                        </div>
                        <div class="rows"><label>adresse IP : </label>{if isset($vendeur->Vendeur_Adresse_Ip)}{$vendeur->Vendeur_Adresse_Ip}{/if}</div>
                        <div class="rows"><label>Localisation IP : </label>{if isset($vendeur->Vendeur_Localisation_Ip)}{$vendeur->Vendeur_Localisation_Ip}{/if}</div>
                    </div>
                
                <!--  fin param -->
                <!-- details de la reference-->
                <div class="cadre1">
                	<div class="title">Détails de la référence</div>
                  
                    <div class="rows"><label>Valide :</label> {if ($voiture->Occas_Valide == 1)}oui{else}non{/if}</div>
                    <div class="rows"><label>Numéro de parution :</label>   {if ($an_num_parut != 0)}{$an_num_parut}{/if}</div>
                    {if isset($an_num_refer )}
                        <div class="rows"><label>Numéro de référence :</label> {$an_num_refer}</td></div>
                    {/if}
                    <div class="rows"><label>Date de saisie :</label> {if isset($voiture->Occas_DateSaisie)}{$voiture->Occas_DateSaisie}{/if}</div>
                    <div class="rows"><label>Date de modification :</label> {if isset($voiture->Occas_DateModif)}{$voiture->Occas_DateModif}{/if}</div>
                    <div class="rows"><label>Partenaire :</label>  {$an_partenaire}</div>
                    <div class="rows"><label>Source :</label> {if !$voiture->Occas_Operateur}Particulier{else}Administrateur{/if}</div>
                    {if (isset($an_reference->prov) &&($an_reference->prov != '')) }
                    <div class="rows"><label>Provenance :</label> {$an_reference->prov}</div>
                    {/if}
                    <div class="rows"><label>Parution :</label> {if isset($an_reference->parut)}{$an_reference->parut}{/if}</div>
                    <div class="rows"><label>Photo :</label>  {if isset($an_reference->photo)}{$an_reference->photo}{/if}</div>
                    <div class="rows"><label>Enrichissement :</label> {if isset($an_reference->enr)}{$an_reference->enr}{/if}</div>
                    {if (($voiture->Occas_TypePaiement != 'g')&&($voiture->Occas_TypePaiement != ''))}
                        <div class="rows"><label>Montant payé :</label> {if isset($voiture->Occas_Montantpaye)}{$voiture->Occas_Montantpaye}{/if}€</div>
                    {/if}
                    <div class="rows"><label>Montant reglé :</label> {if ($voiture->Occas_Estsaisie == 1)}oui{else}non{/if}</div>
                    <div class="rows"><label>Type paiement :</label> {if ($voiture->Occas_TypePaiement == 'cb')}Carte bancaire{elseif ($voiture->Occas_TypePaiement == 'ch')}Chèque{elseif ($voiture->Occas_TypePaiement == 'md')}Mandat{elseif $voiture->Occas_TypePaiement == 'g'}Gratuit{/if}</div>
                    <div class="rows"><label>Opérateur :</label> {if $voiture->Occas_Operateur}{$voiture->Occas_Operateur}{else}Particulier{/if}</div>
                    <div class="rows"><label>Formule choisie :</label> 
                         <span {if ( isset($modifAnonce) && (($modifAnonce->modifFormule == 4) || ($modifAnonce->modifFormule == 7)))} class='marked'{/if}>
                            {$formuleSelected->titre}
                         </span>
                     </div>

                       <div class="rows">
                       	<label title="Options supplémentaires">Options supp:</label>  
                         <span {if ( isset($modifAnonce) && (($modifAnonce->modifFormule == 5) || ($modifAnonce->modifFormule == 7)))} class='marked'{/if}>
                            <ul style="width:145px; margin:0 0 0 14px; padding:0; float:left;">
                                {foreach $recapAnnonceChoix as $key=>$itemRecap}
                                    <li>{$itemRecap->lib_option_formule} : {$itemRecap->formch_libelle}</li>
                                {/foreach}
                            </ul>
                         </span>
                     </div>
                </div>
                {/if}
                <!-- fin details de la reference-->
            	
                
                <div class="submitForm" style="float:left; width:100%;">
                    <a title="Modifier" href="{jurl 'annonce~BoAnnonce:editer',array('idOccasion'=>$voiture->IdOccasion)}" class="bt_green" style="float:left; clear:none; "><span class="bt_green_lft"></span><strong>Modifier</strong><span class="bt_green_r"></span></a>
                    <a title="Valider" href="{jurl 'annonce~BoAnnonce:modifyStatus',array('idOccasion'=>$idOccasion,'status'=>1)}" class="bt_green" style="float:left; clear:none; "><span class="bt_green_lft"></span><strong>Valider</strong><span class="bt_green_r"></span></a><br />
                    <a title="Archiver" href="{jurl 'annonce~BoAnnonce:modifyStatus',array('idOccasion'=>$idOccasion,'status'=>2)}" class="bt_green" style="float:left;"><span class="bt_green_lft"></span><strong>Archiver</strong><span class="bt_green_r"></span></a>
                    <a  title="Supprimer" href = "#" class="bt_red visuadvert" style="float:left; clear:none;"><span class="bt_red_lft"></span><strong>Supprimer</strong><span class="bt_red_r"></span></a>
                    <a title="Gerer formule/option " href="{jurl 'annonce~BoAnnonce:formuleOptions',array('idOccasion'=>$idOccasion)}" class="bt_green" style="float:left; clear:none;"><span class="bt_green_lft"></span><strong>Formule</strong><span class="bt_green_r"></span></a>
                </div>
                
            </div>
          </div>
        </div>
        <!-- end of right content--> 
      </div>
      <!--end of center content -->
    </form>
    <div class="clear"></div>
  </div>
  <!--end of main content-->
  
  <div class="footer"> </div>
</div>
 <div style="display:none;">
<div id="popBlock" class="pop-up">
    <a href="#" class="close">Fermer</a>
    <!--begin gallery-->
    <div id="gallery2">
      <div id="controls2" class="controls"></div>
      <div class="slideshow-container">
        <div id="loading2" class="loader"></div>
        <div id="slideshow2" class="slideshow"></div>
      </div>
      <div id="caption2" class="caption-container"></div>
    </div>
    <div id="thumbs2" class="navigation">
      <ul class="thumbs">
          
       {if sizeof($photo)}
            {foreach $photo as $itemPhoto}
                {if $itemPhoto->photo_name}
                    <li><a class="thumb" href="{$imgPath}{$itemPhoto->photo_name}"><img  src="{$imgPath}{$itemPhoto->photo_name}" /></a></li>
                {/if}
            {/foreach}
        {elseif $annonceS->marque_logo}
            <li><a class="thumb" href="{$annonceS->marque_logo}"><img  src="{$annonceS->marque_logo}" width="60" /></a></li>
        {else}
            <li><a class="thumb" href="{$j_basepath}design/front/images/no-image-home2.jpg"><img  src="{$j_basepath}design/front/images/no-image-home2.jpg" /></a></li>
        {/if}
      </ul>
    </div>
    <div class="clear">&nbsp;</div>
    <!--end gallery-->
</div>

</div>

{if $vendeur->Vendeur_Email}
    <div id="popvisuadvert" class="pop-up cgv">
<a href="#" class="close" style="float:right;margin-right:20px;">Fermer</a>
        <form action="{jurl 'annonce~BoAnnonce:modifyStatus'}" method="post" style="width:325px;margin:20px auto;">
        <input type="hidden" name="idOccasion" value="{$idOccasion}"/>
        <input type="hidden" name="status" value="3"/>
            <fieldset>
                <p> 
                    <label> Mail du vendeur : </label><input type="text" name="mail_vendeur" value="{$vendeur->Vendeur_Email}" style="width:195px;" readonly />
                </p>
                <h2>Veuillez choisir le mail à envoyer</h2>
                <p>
                    <select name='mailtpl'>
                        <option value="0"></option>
                        {foreach $templatemail as $item}
                            <option value="{$item->mail_id}">{$item->mail_name}</option>
                        {/foreach}
                    </select>
                </p>
                <p> 
                    <input type="submit" name="valider" value="OK" />
                </p>
            </fieldset>
        </form>
    </div>
{else}
    <div id="popvisuadvert" class="pop-up cgv">
<a href="#" class="close" style="float:right;margin-right:20px;">Fermer</a>
        <form action="{jurl 'annonce~BoAnnonce:modifyStatus'}" method="post" style="width:325px;margin:20px auto;">
                <input type="hidden" name="idOccasion" value="{$idOccasion}"/>
                <input type="hidden" name="status" value="3"/>
            <fieldset>
                <h4>Le vendeur n'a pas de mail.</h4>
                <p> 
                    <input type="submit" name="valider" value="Supprimer" />
                </p>

            </fieldset>
        </form>
    </div>


{/if}

<div id="masque"></div>  
